package com.plugin.core.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 合同实体类
 * 
 * @author mark
 * @date 2025-07-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("elder_contract")
@Schema(name = "ElderContract", description = "合同表")
public class ElderContract {

    @Schema(description = "合同ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "合同编号")
    @TableField("contract_number")
    private String contractNumber;

    @Schema(description = "长者ID")
    @TableField("elder_id")
    private Long elderId;

    @Schema(description = "合同开始日期")
    @TableField("start_date")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate startDate;

    @Schema(description = "合同结束日期")
    @TableField("end_date")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate endDate;

    @Schema(description = "押金")
    @TableField("deposit")
    private BigDecimal deposit;

    @Schema(description = "付款方式：1-月付，3-季付，6-半年付，12-年付")
    @TableField("payment_method")
    private Integer paymentMethod;

    @Schema(description = "签订日期")
    @TableField("signed_date")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate signedDate;

    @Schema(description = "合同文件路径")
    @TableField("contract_file")
    private String contractFile;

    @Schema(description = "真实图片")
    @TableField("file_img")
    private String fileImg;

    @Schema(description = "状态：0-已终止，1-生效中，2-已到期")
    @TableField("status")
    private Integer status;

    @Schema(description = "终止日期")
    @TableField("termination_date")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate terminationDate;

    @Schema(description = "终止原因")
    @TableField("termination_reason")
    private String terminationReason;

    @Schema(description = "备注")
    @TableField("remark")
    private String remark;

    @Schema(description = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @Schema(description = "是否删除：0-未删除，1-已删除")
    @TableField("del")
    private Integer del;
}
